/*
-------------------------------------------------------------------------------
This file is part of FlyingPaper.

Copyright (c) 2009-2010 Emilien Dupont
Also see acknowledgements in COPYING.txt

FlyingPaper is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

FlyingPaper is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with FlyingPaper. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------------
*/

/**
 * \file state.h
 * \brief State class definition
 * \author Emilien Dupont
 *
 * This file contains the definition of the State class which defines a
 * programme state.
 */

#ifndef STATE_H
#define STATE_H

#include <ogre.h>
#include <OIS/OIS.h>

/**
 * \class State
 *
 * This class corresponds to a programme state (ie menu state, game state,
 * credits state, ...).
 */
class State
{
    public:
        /**
         * \brief Constructor
         */
        State();
        /**
         * \brief Destructor
         */
        virtual ~State();

        /**
         * \brief Method called when the state is added to a state manager
         */
        virtual void init() = 0;
        /**
         * \brief Method called when this state becomes active
         */
        virtual void enter() = 0;
        /**
         * \brief Method called when the state becomes inactive
         */
        virtual void leave() = 0;

        /**
         * \brief Method called at each frame
         */
		virtual bool frameStarted(const Ogre::FrameEvent &evt);

        /**
         * \brief Method which manages keyboard's input
         */
		virtual bool keyPressed(const OIS::KeyEvent &e);
		/**
         * \brief Method which manages keyboard's input
         */
        virtual bool keyReleased(const OIS::KeyEvent &e);

        /**
         * \brief Method which manages mouse's movements
         */
        virtual bool mouseMoved(const OIS::MouseEvent &e);
        /**
         * \brief Method which manages mouse's clicks
         */
        virtual bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
        /**
         * \brief Method which manages mouse's clicks
         */
        virtual bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);

        /**
         * \brief Return the name of the states
         */
        Ogre::String getName();

    protected:
        Ogre::String _Name;
        Ogre::Camera *_Camera;
        Ogre::SceneManager* _SceneManager;
};

#endif // STATE_H
